#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=1e5+9;
int shop[N];
int mem[N];
int dp[N];
int n;
int dfs(int x)
{
	if(mem[x])return mem[x];
	int sum=0;
	if(x>n)	sum=0;
	else sum=max(dfs(x+1),shop[x]+dfs(x+2));
	mem[x]=sum;
	return sum;
}
int main()
{
	int T;
	cin>>T;
	while(T--)
	{
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&shop[i]);
		}
		memset(mem,0,sizeof(mem));
		memset(dp,0,sizeof(dp));
		for(int i=n;i>=1;i--)
		{
			dp[i]=max(dp[i+1],dp[i+2]+shop[i]);
		}
		//printf("%d\n",dfs(1));
		printf("%d\n",dp[1]);
	}	
	return 0;
}
